#ifndef MAGICCUBESCENE_H
#define MAGICCUBESCENE_H
#include "Scene/Scene.h"
#include "Math/MathDefines.h"
#include <QList>
#include<synchapi.h>
#include<QObject>
#define PI 3.141592653589793
#define max_range 2.1      //设置正方体中心向外最大偏移量
#define min_range 1.9      //设置正方体中心最内最大偏移量
namespace GCL {  namespace MagicCube {
class Cube;
class MagicCubeScene : public Scene
{
public:
    //explicit MagicCubeScene(QObject *parent = nullptr);
    MagicCubeScene();
    virtual ~MagicCubeScene();
    void initCubes();
    void drawDiagnolline();
public: ///  render
    void renderObjects();

    //------旋转魔方
    void cubeRotato();

public:
    //----选择对应面
    void selectCubeFace(int select_face_);
    void cleanKey();
    void timerRun();
    void keyUp(const unsigned int& key, unsigned int modifier = NoModifier);

private:
    QList< std::shared_ptr<Cube> > cubes_;
    QList<int> key_list_;
    int cubeNumber_[9] = {};
    Vec3 axis_;
    Vec3 axis_temp_;
    bool cube_rotato_control_ = false;
    int rotato_account_ = 0;
    bool clean_key_signal_ = true;
    bool draw_diagonal_signal_ = false;
};
}}
#endif // MAGICCUBESCENE_H
